package com.shrcl.engineerprocess.domain.impl;

import com.shrcl.engineerprocess.domain.TSCPhase;
import com.shrcl.engineerprocess.domain.proxy.TSCPhaseProxy;
import edu.fudan.langlab.domain.code.impl.CodeImpl;
import edu.fudan.mylang.pf.IObjectFactory;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@Entity
@DiscriminatorValue("TSCPHASE_TYPE")
public class TSCPhaseImpl extends CodeImpl implements TSCPhase {
  public TSCPhaseImpl() {
    super();
  }
  
  public static TSCPhase create(final IObjectFactory objectFactory) {
    com.shrcl.engineerprocess.domain.TSCPhase tSCPhase = new com.shrcl.engineerprocess.domain.impl.TSCPhaseImpl(
    );
    objectFactory.create(tSCPhase);
    return tSCPhase;			
    
  }
  
  public static TSCPhase createTSCPhaseImpl(final IObjectFactory objectFactory, final Procedure1<TSCPhase> init) {
    com.shrcl.engineerprocess.domain.TSCPhase tSCPhase = new com.shrcl.engineerprocess.domain.impl.TSCPhaseImpl(
    );
    objectFactory.create(tSCPhase);
    init.apply(tSCPhase);
    
    return tSCPhase;			
    
  }
  
  public TSCPhaseProxy toProxy() {
    com.shrcl.engineerprocess.domain.proxy.TSCPhaseProxy proxy = new com.shrcl.engineerprocess.domain.proxy.TSCPhaseProxy();
    proxy.setId(this.getId());
    if(this instanceof edu.fudan.mylang.pf.INamedModelObject){
    	proxy.setName(((edu.fudan.mylang.pf.INamedModelObject)this).getEntityName());
    }
    return proxy;
    
  }
}
